package com.ccp.dev.system.model;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

/**
 * 对象功能:租户资源映射 Model对象
 * @author :史小龙
 * 创建时间:2017-04-05 11:17:15
 */
public class SysTenantResource extends SysDataResource {
    /**
     * 租户资源Id
     */
    protected String tenantResourceId;

    protected String systemId;
    /**
     * 资源主键
     */
    protected String resourceId;
    /**
     * 是否可用
     */
    protected int status;

    public void setTenantResourceId(String tenantResourceId) {
        this.tenantResourceId = tenantResourceId;
    }

    /**
     * 返回 租户资源Id
     *
     * @return
     */
    public String getTenantResourceId() {
        return tenantResourceId;
    }


    public void setResourceId(String resourceId) {
        this.resourceId = resourceId;
    }

    /**
     * 返回 资源主键
     *
     * @return
     */
    public String getResourceId() {
        return resourceId;
    }


    public String getSystemId() {
        return systemId;
    }

    public void setSystemId(String systemId) {
        this.systemId = systemId;
    }


    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    /**
     * @see Object#equals(Object)
     */
    @Override
    public boolean equals(Object object) {
        if (!(object instanceof SysTenantResource)) {
            return false;
        }
        SysTenantResource rhs = (SysTenantResource) object;
        return new EqualsBuilder()
                .append(this.tenantResourceId, rhs.tenantResourceId)
                .append(this.tenantId, rhs.tenantId)
                .append(this.resourceId, rhs.resourceId)
                .append(this.status, rhs.status)
                .isEquals();
    }

    /**
     * @see Object#hashCode()
     */
    @Override
    public int hashCode() {
        return new HashCodeBuilder(-82280557, -700257973)
                .append(this.tenantResourceId)
                .append(this.tenantId)
                .append(this.resourceId)
                .append(this.status)
                .toHashCode();
    }

    /**
     * @see Object#toString()
     */
    @Override
    public String toString() {
        return new ToStringBuilder(this)
                .append("tenantResourceId", this.tenantResourceId)
                .append("tenantId", this.tenantId)
                .append("resourceId", this.resourceId)
                .append("status", this.status)
                .toString();
    }

    @Override
    public Object clone() {
        SysTenantResource obj = null;
        try {
            obj = (SysTenantResource) super.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return obj;
    }
}
